<!DOCTYPE html>
<html lang="en">
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <meta charset="utf-8" />
        <title>欢迎语设置{:config('APP_NAME')}</title>

        <meta name="description" content="overview &amp; stats" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

        <!-- bootstrap & fontawesome -->
        <link rel="stylesheet" href="__PUBLIC__/static/css/bootstrap.min.css" />
        <link rel="stylesheet" href="__PUBLIC__/static/css/font-awesome.min.css" />

        <!-- page specific plugin styles -->

        <!-- text fonts -->
        

        <!-- ace styles -->
        <link rel="stylesheet" href="__PUBLIC__/static/css/ace.min.css" />

        <!--[if lte IE 9]>
            <link rel="stylesheet" href="__PUBLIC__/static/css/ace-part2.min.css" />
        <![endif]-->
        <link rel="stylesheet" href="__PUBLIC__/static/css/ace-skins.min.css" />
        <link rel="stylesheet" href="__PUBLIC__/static/css/ace-rtl.min.css" />

        <!--[if lte IE 9]>
          <link rel="stylesheet" href="__PUBLIC__/static/css/ace-ie.min.css" />
        <![endif]-->

        <!-- inline styles related to this page -->

        <!-- ace settings handler -->
        <script src="__PUBLIC__/static/js/ace-extra.min.js"></script>

        <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->

        <!--[if lte IE 8]>
        <script src="__PUBLIC__/static/js/html5shiv.js"></script>
        <script src="__PUBLIC__/static/js/respond.min.js"></script>
        <![endif]-->
    </head>

    <body class="no-skin">
        {include file="common/header"}
        <div class="main-container" id="main-container">
            <script type="text/javascript">
                try{ace.settings.check('main-container' , 'fixed')}catch(e){}
            </script>

            {include file="common/left"}
            <div class="main-content">
                <div class="breadcrumbs  breadcrumbs-fixed" id="breadcrumbs">
                    <script type="text/javascript">
                        try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
                    </script>

                    <ul class="breadcrumb">
                        <li>
                            <i class="ace-icon fa fa-home home-icon"></i>
                            <a href="#">Home</a>
                        </li>
                        <li class="active">Dashboard</li>
                    </ul><!-- /.breadcrumb -->
                </div>

                <div class="page-content">


                    <div class="row">
                        <div class="col-xs-12">
                            <!-- PAGE CONTENT BEGINS -->
                            <div class="alert alert-block alert-success">
                                <button type="button" class="close" data-dismiss="alert">
                                    <i class="ace-icon fa fa-times"></i>
                                </button>



                                <p class="desc"> <i class="ace-icon fa fa-check green"></i>为保障用户体验，微信公众平台严禁恶意营销以及诱导分享朋友圈，严禁发布色情低俗、暴力血腥、政治谣言等各类违反法律法规及相关政策规定的信息。一旦发现，我们将严厉打击和处理。 </p>
                            </div>


                            <div class="content" id="welcome">
                                <div class="widget widget-primary">
                                    <div class="widget-body">
                                        <div class="main_bd" id="main-bd">



                                            <material-list @save="saveList"></material-list>

                                            <div style="text-align: center; padding-top: 50px; ">
                                                <i-button type="success" @click="saveSend" >保存设置</i-button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>



                            <!-- PAGE CONTENT ENDS -->
                        </div><!-- /.col -->
                    </div><!-- /.row -->
                </div><!-- /.page-content -->
            </div><!-- /.main-content -->

            {include file="common/footer"}

            <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
                <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
            </a>
        </div><!-- /.main-container -->

        <!-- basic scripts -->
        {include file="common/base_js"}
        <script src="https://cdn.bootcss.com/vue/2.4.4/vue.min.js"></script>
        <script src="https://cdn.bootcss.com/axios/0.15.3/axios.min.js"></script>
        {include file="common/dialog/list_dialog"}
        <!-- inline scripts related to this page -->
        <script type="text/javascript">
            !function($){
                "use strict";

                function start_root(){
                    new Vue({
                        el: "#welcome",
                        data: {
                            message:{ }
                        },
                        methods: {
                            saveList: function (obj, type) {

                                this.message = {}
                                this.message.msgType = type;
                                if( type == 2 ) {
                                    this.message.imageId = obj.img.id;
                                }else if( type == 10 ) {
                                    this.message.newsId = obj.new.id;
                                }else if( type == 3 ) {
                                    this.message.voiceId = obj.voice.id;
                                }else if( type == 15 ) {
                                    this.message.videoId = obj.video.id;
                                }

                                console.log(this.message)
                            },
                            saveSend: function () {
                                var This = this;

                                if(!this.message.msgType) {
                                    This.$Notice.warning({
                                        title: "请先设置内容",
                                        desc: ''
                                    });
                                } else {
                                    $.post('${ctx}/welcome/save', this.message, function (r) {
                                        This.$Notice.info({
                                            title: r.msg,
                                            desc: ''
                                        });
                                    }, 'json');
                                }
                            }
                        }
                    });
                }

                $(function(){
                    start_root();
                })

            }(jQuery)
        </script>
    </body>
</html>
